package main

import "fmt"

func main() {
	str1 := "abc"
	str2 := "xyz"
	mergedStr := mergeString(str1, str2)
	fmt.Println("合并后的字符串： ", mergedStr)
}

func mergeString(str1, str2 string) string {
	var merged []rune
	r1 := []rune(str1)
	r2 := []rune(str2)
	
	len1 := len(r1)
	len2 := len(r2)
	i, j := 0, 0
	for i < len1 || j < len2 {
		if i < len1 {
			merged = append(merged, r1[i])
			i++
		}
		if j < len2 {
			merged = append(merged, r2[j])
			j++
		}
	}
	return string(merged)
}
